struct sFog
{
	bool Enabled;
	float Start;
	float End;
	float3 Color;
};


float Fog_ComputeFactor(sFog instance, float d)
{
    return clamp((d - instance.Start) / (instance.End - instance.Start), 0, 1) * instance.Enabled;
}

float3 Fog_ComputeColor(sFog instance, float3 color, float factor)
{
	return lerp(color.rgb, instance.Color, factor);
}
